package demo2;
//定义抽象类作为父类
public  class Animal implements Irunable  {
    public String name;
    public int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }//构造方法来初始化变量
    //重写接口方法


    @Override
    public void run() {
        System.out.println("跑步");
    }

    @Override
    public void running() {
        System.out.println("正在跑步");
    }
}
